package com.abbas.wallerpaper.ui;

import androidx.appcompat.app.AppCompatActivity;
import androidx.viewpager.widget.ViewPager;

import android.os.Bundle;
import android.widget.ImageButton;

import com.abbas.wallerpaper.R;
import com.abbas.wallerpaper.adapter.FlowerAdapter;
import com.abbas.wallerpaper.base.BaseActivity;
import com.abbas.wallerpaper.entity.ImageBean;
import com.abbas.wallerpaper.view.ZoomOutPageTransformer;

import java.util.ArrayList;
import java.util.List;

public class Detail2Activity extends BaseActivity {
    private ImageButton ib;
    private ViewPager mViewPager;

    private ImageBean.ResBean.VerticalBean imgBean;
    @Override
    protected int getLayoutId() {
        return R.layout.activity_deatil2;
    }

    @Override
    protected void init() {
        ib = (ImageButton) findViewById(R.id.ib);
        mViewPager = (ViewPager) findViewById(R.id.vp);

        imgBean = (ImageBean.ResBean.VerticalBean) getIntent().getSerializableExtra("data");

    }

    @Override
    protected void initEvent() {

        List<Integer> urlList = new ArrayList<>();
        urlList.add(R.drawable.clannad);
        urlList.add(R.drawable.sh);
        urlList.add(R.drawable.xjp);
        mViewPager.setAdapter(new FlowerAdapter(this, urlList));
        mViewPager.setPageMargin(20);
        mViewPager.setOffscreenPageLimit(urlList.size());
        mViewPager.setPageTransformer(true, new ZoomOutPageTransformer());//设置画廊模式


    }
}